﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
   

<h1>New User | Добавление пользователя в список:  </h1>
 


<form:form action="${action}" commandName="user" modelAttribute="user" method="POST">

	<form:errors path="*" cssClass="errorblock" element="div" />
	
	<form:input path="login" /> <form:errors path="login" cssClass="error" /> <br/>
	<form:input path="password" /> <form:errors path="password" cssClass="error" /> <br/>
        <form:input path="name" /> <form:errors path="name" cssClass="error" /> <br/>
        <form:input path="email" /> <form:errors path="email" cssClass="error" /> <br/>
        <form:input path="passportCode" /> <form:errors path="passportCode" cssClass="error" /> <br/>


	<form:label path="accessRole">Access role | Права доступа:</form:label><br/>
	<form:select path="accessRole">
        <form:option value="user" label="user" />
	<form:options items="${accessList}" />
	</form:select>
	<form:errors path="accessRole" cssClass="error" />


	
	<c:if test="${user.userId > 0}" >
	<form:label path="userId">ID1:</form:label>
	<form:hidden path="userId" /> ${user.userId} <br/><br/>
	</c:if>
	
	<c:if test="${user.userId == 0}" >
	  <form:label path="userId">ID:</form:label> <form:input path="userId"/>
	  <form:errors path="userId"/> <br/><br/>
    </c:if>	  
			
	<input type="submit" value="Save | Сохранить" />
	<input type="reset" value="Cancel | Отмена" onclick="window.history.back();"/>
  
</form:form> 
